import logging

_logger = None


def get_logger():
    global _logger
    if _logger:
        return _logger
    console = logging.StreamHandler()

    console.setLevel(logging.INFO)

    #set a format which is simple for console use

    formatter = logging.Formatter("%(name)s: %(levelname)-8s %(message)s")

    #tell the handler to use this format

    console.setFormatter(formatter)

    # set initial log level
    logger = logging.getLogger("")
    if not console in logger.handlers:
        logger.addHandler(console)
    logger.setLevel(logging.DEBUG)
    _logger = logger
    return logger


class SyncHook(object):
    def __init__(self):
        self.logger = get_logger()

    def sync(self, category, sync_source):
        pass